package com.orange.lswidget;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;


/**
 * @author gaoge
 *This class is made up a Lockscreen WidgetProvider ,which likes the system's
 *AppWidgetProvider,But this provider's xml file event_lswidget_provider.xml
 *is parsed by class LSWidgetService's function parseProviderInfoXml 
 *
 */
public class LSWidgetProvider extends BroadcastReceiver {

	public void onReceive(Context context, Intent intent) {
		String action = intent.getAction();

		if (LSWidgetManager.ACTION_LSWIDGET_UPDATE.equals(action)) {
			Bundle extras = intent.getExtras();
			if (extras != null) {
				int viewType = extras
						.getInt(LSWidgetManager.EXTRA_LSWIDGET_TYPE);
				this.onUpdate(context, viewType);
			}
		} else if (LSWidgetManager.ACTION_LSWIDGET_DELETED.equals(action)) {
			this.onDeleted(context);
		} else if (LSWidgetManager.ACTION_LSWIDGET_ENABLED.equals(action)) {
			this.onEnabled(context);
		} else if (LSWidgetManager.ACTION_LSWIDGET_DISABLED.equals(action)) {
			this.onDisabled(context);
		}
	}

	public void onUpdate(Context context, int viewType) {
	}

	public void onDeleted(Context context) {
	}

	public void onEnabled(Context context) {
	}

	public void onDisabled(Context context) {
	}
}
